<?php

class Damages_ReportsController extends Zend_Controller_Action {

  private $params;

  public function init() {
    $this->_helper->layout->disableLayout();
    $action = $this->getRequest()->getActionName();
    $this->_helper->viewRenderer->setNoRender(true);
    $params = array();
    $params['from'] = $this->getRequest()->getParam('from');
    $params['to'] = $this->getRequest()->getParam('to');
    $params['type'] = $this->getRequest()->getParam('type');
    $this->params = new Damages_DynamicClass($params);
    if ($this->params === null)
      throw new Damages_Exception_App(Damages_Codes::ERROR_NO_PARAMS);
    Damages_Auth::getInstance();
  }

  public function generateReportAction() {
    $request = new Damages_Methods_Request_GenerateReport($this->params);
    $request->process();
  }

}